Skip to content

MessageFormatter parse error improvements (PHP-7.4 edition) #6325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

pilif
Copy link
Contributor

@pilif pilif commented Oct 12, 2020

This is the PHP 7.4 version of #6306, targeting PHP-7.4 as @nikic said in the other PR that this might possibly go into 7.4.

There were a few minor conflicts which I have fixed as part of this rebase.

Feel free to close whichever of the two PRs you don't want to merge.

pilif added 2 commits October 12, 2020 14:52
the message patterns can be pretty complex, so reporting a generic
U_PARSE_ERROR without any additional information makes it needlessly
hard to fix erroneous patterns.

This commit makes use of the additional UParseError* parameter to
umsg_open to retrieve more details about the parse error to report that
to the user via intl_get_error_message()
All possible failures when calling IntlMessage::__construct() would be
masked away with a generic "Constructor failed" message. This would
include invalid patterns.

This commit makes sure that the underlying error that caused the
constructor failure is reported as part of the IntlException error
message.

Additionally, similar to the previous commit, this also uses this
improved error reporting facility to also report details on parsing
errors while trying to parse the message pattern
@pilif pilif changed the title Intl message parse 7.4 MessageFormatter parse error improvements (PHP-7.4 edition) Oct 12, 2020
@php-pulls php-pulls closed this in 74cf2eb Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant